package com.logic.player
{
	public class Property
	{
		private var _hp:Number = 100;
		private var _mp:Number = 100;
		private var _hpMax:Number = 100;
		private var _mpMax:Number = 100;
		public function Property()
		{
		}

		public function get hp():Number
		{
			return _hp;
		}
		
		public function set hp(value:Number):void
		{
			value = value < 0 ? 0 : (value > hpMax ? hpMax : value);
			_hp = value;
		}

		public function get mp():Number
		{
			return _mp;
		}

		public function set mp(value:Number):void
		{
			value = value < 0 ? 0 : (value > mpMax ? mpMax : value);
			_mp = value;
		}

		public function get hpMax():Number
		{
			return _hpMax;
		}

		public function set hpMax(value:Number):void
		{
			if(value > 0){
				hp = hp / hpMax * value;
			}else{
				hp = 0;
				value = 0;
			}
			_hpMax = value;
		}

		public function get mpMax():Number
		{
			return _mpMax;
		}

		public function set mpMax(value:Number):void
		{
			if(value > 0){
				mp = mp / mpMax * value;
			}else{
				mp = 0;
				value = 0;
			}
			_mpMax = value;
		}


	}
}